function string.split(str, delimiter)
        if str==nil or str=='' or delimiter==nil then
                return nil
        end

    local result = {}
    for match in (str..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match)
    end
    return result
end

local key = KEYS[1]

local argStr = ARGV[1]

local args = string.split(argStr, ",")

local result = {}

for i,v in ipairs(args) do
    
    local index = redis.call("zrank", "RptRecvSerialsZSet", v)
    table.insert(result, index)

end

return result
